import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/initPage/index.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'main',
      // component: () => import('../views/sciChart/index.vue'),
      redirect: '/sciChart',
      children: [
        {
          path: '/',
          name: 'home',
          meta: { title: '首页' },
          component: HomeView,
        },
        {
          path: '/sciChart',
          name: 'sciChart',
          meta: { title: 'sciChart' },
          component: () => import('../views/sciChart/index.vue'),
        },
      ],
    },
    {
      path: '/practice',
      name: 'practice',
      component: () => import('../components/sciChartComponents/practice.vue'),
    },
  ],
});

export default router;
